# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=beancount-language-server
pkgver=1.2.5
pkgrel=0
pkgdesc="Language server for Beancount files"
url="https://github.com/polarmutex/beancount-language-server"
license="MIT"
arch="all !s390x !riscv64" # blocked by rust/cargo
makedepends="cargo"
source="https://github.com/polarmutex/beancount-language-server/archive/v$pkgver/beancount-language-server-$pkgver.tar.gz"
options="!check" # no test suite

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --frozen --release
}

package() {
	install -Dm755 target/release/beancount-language-server -t "$pkgdir"/usr/bin/
}

sha512sums="
a147bbbd0dc376e6d38017ab6d0edf5bae9dc8fcea2bcd2bf0d7679499a1975d30603337db2de240c5712d5f36bfbf01818ea8e9b337aab9a3408062b23a77c9  beancount-language-server-1.2.5.tar.gz
"
